//
//  StrategyMoreSortView.m
//  NewNest
//
//  Created by hesiyao on 16/1/22.
//  Copyright © 2016年 www.lanou3g.com蓝鸥科技. All rights reserved.
//

#import "StrategyMoreSortView.h"
#import "StrategyMoreSortCell.h"
@interface StrategyMoreSortView () <UICollectionViewDataSource, UICollectionViewDelegate>

@end

@implementation StrategyMoreSortView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
        self.collectionview = [[UICollectionView alloc] initWithFrame:self.bounds collectionViewLayout:layout];
        layout.itemSize = CGSizeMake((self.frame.size.width - 40) / 3, self.frame.size.height / 10);
        layout.sectionInset = UIEdgeInsetsMake(5, 5, 5, 5);
        [self addSubview:_collectionview];
        [_collectionview release];
        _collectionview.delegate = self;
        _collectionview.dataSource = self;
        _collectionview.backgroundColor = [UIColor whiteColor];
        
        [_collectionview registerClass:[StrategyMoreSortCell class] forCellWithReuseIdentifier:@"cell"];
        
        
    }
    return self;
}
//cell个数
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
    return 21;
}

//
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
    StrategyMoreSortCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"cell" forIndexPath:indexPath];
//    cell.backgroundColor = [UIColor cyanColor];
    if (indexPath.row == 0) {
        cell.titleLabel.text = @"装修选材";
    }else if (indexPath.row == 1) {
        cell.titleLabel.text = @"验房须知";
    }else if (indexPath.row == 2) {
        cell.titleLabel.text = @"装修合同";
    }else if (indexPath.row == 3) {
        cell.titleLabel.text = @"装修预算";
    }else if (indexPath.row == 4) {
        cell.titleLabel.text = @"装修风水";
    }else if (indexPath.row == 5) {
        cell.titleLabel.text = @"装修设计";
    }else if (indexPath.row == 6) {
        cell.titleLabel.text = @"装修要点";
    }else if (indexPath.row == 7) {
        cell.titleLabel.text = @"装修选材";
    }else if (indexPath.row == 8) {
        cell.titleLabel.text = @"建材安装";
    }else if (indexPath.row == 9) {
        cell.titleLabel.text = @"拆改工程";
    }else if (indexPath.row == 10) {
        cell.titleLabel.text = @"水电工程";
    }else if (indexPath.row == 11) {
        cell.titleLabel.text = @"防水工程";
    }else if (indexPath.row == 12) {
        cell.titleLabel.text = @"泥瓦工程";
    }else if (indexPath.row == 13) {
        cell.titleLabel.text = @"水木工程";
    }else if (indexPath.row == 14) {
        cell.titleLabel.text = @"油漆工程";
    }else if (indexPath.row == 15) {
        cell.titleLabel.text = @"装修污染";
    }else if (indexPath.row == 16) {
        cell.titleLabel.text = @"装修验收";
    }else if (indexPath.row == 17) {
        cell.titleLabel.text = @"家居护理";
    }else if (indexPath.row == 18) {
        cell.titleLabel.text = @"家居配饰";
    }else if (indexPath.row == 19){
        cell.titleLabel.text = @"家电家私";
    }else {
        cell.titleLabel.text = @"取消筛选";
    }
    return cell;
}

- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
{
    
}



/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
